package solution;

import com.sun.org.apache.bcel.internal.generic.D2F;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ws
 * Date: 2023-01-17
 * Time: 22:42
 */
public class Solution7 {

    public static void main(String[] args) {
        for (int i = 1; i < 1000; i++) {
            int j = divSum1(i);
            if (i == divSum1(j)) {
                System.out.println("甲" + i + "乙" + j);
            }
        }
    }

    private static int divSum1(int n) {
        int sum = 1;
        for (int i = 2; i * i <= n; i++) {
            if (n % i == 0) {
                sum += i;
                if (i * i < n) {
                    sum += n / i;
                }
            }
        }
        return sum;
    }
    public static int divSum(int n) {
        int sum = 0;
        for (int i=1;i<n;i++) {
            if (n%i == 0) {
                sum+=i;
            }
        }
        return sum;
    }
}
